package java8_24;

/**
 * @author oldliu
 * @since 1.0
 */
public class Dog {
    private String name;
    private String color;

    public Dog(String name, String color) {
        this.name = name;
        this.color = color;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    //这个类的所有对象共享这个属性
    public static int numOfLegs=4;//狗腿子的数目

    public void show(){
        System.out.println("狗的名字叫"+name+",毛色："+color+",腿的数目："+numOfLegs+"条腿");
    }
    public static void printLegs(){
        System.out.println("狗有"+numOfLegs+"条腿");
        //System.out.println(this.name);
    }
}
